home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / docdem.zip / SAMPPROG.RC < prev   
Text File  |  1991-04-09  |  4KB  |  115 lines

  1. ;*************************************************
  2. ;*                                               *
  3. ;*  Turbo Pascal for Windows                     *
  4. ;*  Demo resource compiler script                *
  5. ;*  Copyright (c) 1991 by Borland International  *
  6. ;*                                               *
  7. ;*************************************************
  8.  
  9. ; SAMPPROG.RC --a sample resource script file
  10. ;             --this script illustrates the use of icons, strings,
  11. ;               menus, and dialog resources in Windows
  12. ;             --this script would be compiled with the resource
  13. ;               compiler and then appended to the pascal program
  14. ;               using the $R compiler directive
  15.  
  16. ; include C-style header files for constant definitions:
  17.  
  18. #include <windows.h>
  19. #include <wobjects.h>
  20. #include <sampprog.h>
  21.  
  22. ; define icons in separate files
  23.  
  24. SampleIcon      ICON    sample.ico
  25.  
  26. ; strings can be defined numerically or symbolically
  27.  
  28. STRINGTABLE
  29. BEGIN
  30.   ids_NoProgrm, "Program unavailable" 
  31.   ids_Invalid, "Invalid entry"
  32.   ids_Fatal, "Fatal error!"
  33. ;  .
  34. ;  . other strings go here
  35. ;  .
  36. END
  37.  
  38. ; Menus define commands for the user
  39.  
  40. SampleMenu MENU
  41. BEGIN
  42.   POPUP "&File"
  43.     BEGIN
  44.      MENUITEM "&New..\tCtrl+N",       cm_FileNew
  45.      MENUITEM "&Open..\tCtrl+O",      cm_FileOpen
  46.      MENUITEM "&Save..\tCtrk+S",      cm_FileSave
  47.      MENUITEM SEPARATOR
  48.      MENUITEM "&Print \tCtrl+P",      cm_FilePrint
  49.     END
  50.   POPUP "&Edit"
  51.     BEGIN
  52.     MENUITEM "&Undo \tAlt+BkSp",      cm_EditUndo
  53.     MENUITEM SEPARATOR
  54.     MENUITEM "&Cut \tShift+Del",      cm_EditCut
  55.     MENUITEM "C&opy \tIns",           cm_EditCopy
  56.     MENUITEM "&Paste \tShift+Ins",    cm_EditPaste
  57.     MENUITEM "&Delete \tDel",         cm_EditDelete
  58.     MENUITEM "C&lear All \tCtrl+Del", cm_EditClear
  59.     END
  60.   POPUP "&View"
  61.     BEGIN
  62.      MENUITEM "Summary \tF2",         cm_ViewSummary
  63.      MENUITEM "Graph \tF3",           cm_ViewGraph
  64.     END
  65. END
  66.  
  67. ; Accelerators provide "hot keys" to menus, commands
  68.  
  69. SampleAccelerators ACCELERATORS
  70. BEGIN
  71.   "^n", cm_FileNew
  72.   "^o", cm_FileOpen
  73.   "^s", cm_FileSave
  74.   "^p", cm_FilePrint
  75.   VK_DELETE, cm_EditCut, VIRTKEY, SHIFT
  76.   VK_INSERT, cm_EditCopy, VIRTKEY
  77.   VK_INSERT, cm_EditPaste, VIRTKEY, SHIFT
  78.   VK_DELETE, cm_EditDelete, VIRTKEY
  79.   VK_DELETE, cm_EditClear, VIRTKEY, CONTROL
  80.   VK_BACK, cm_EditUndo, VIRTKEY, ALT
  81.   VK_F2, cm_ViewSummary, VIRTKEY
  82.   VK_F3, cm_ViewGraph, VIRTKEY
  83. END
  84.  
  85. ; Dialog boxes display information to the user
  86.  
  87. AboutBox  DIALOG 20, 20, 160, 80
  88. CAPTION "About SAMPPROG"
  89. STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
  90. FONT 8, "Helv"
  91. BEGIN
  92.   CTEXT "Sample Program"           -1,   0,  10, 160,  10
  93.   CTEXT "Written in Turbo Pascal"  -1,   0,  26, 160,  10
  94.   CTEXT "for Windows 3.0"          -1,   0,  36, 160,  10
  95.   ICON  "Sample_Icon"              -1,   8,   8,   0,   0
  96.   DEFPUSHBUTTON "OK",            IDOK,  60,  56,  40,  14
  97. END
  98.  
  99. FileOpen DIALOG 20, 20, 204, 124
  100. CAPTION "File Open"
  101. STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
  102. FONT 8, "Helv"
  103. BEGIN
  104.   LTEXT    "File&name:",    -1,   6,   8,  36,  10
  105.   EDITTEXT                 100,  42,   6,  98,  12, ES_AUTOHSCROLL
  106.   LTEXT    "Directory:",    -1,   6,  20,  36,  10
  107.   LTEXT    ""              101,  42,  20,  98,  10
  108.   LTEXT    "&Files:",       -1,   6,  32,  64,  10
  109.   LISTBOX  102, 6, 44, 64, 82, WS_TABSTOP | WS_VSCROLL | LBS_SORT
  110.   LTEXT    "&Directories:", -1,  76,  32,  64,  10
  111.   LISTBOX  103, 76, 44, 64, 82, WS_TABSTOP | WS_VSCROLL | LBS_SORT
  112.   DEFPUSHBUTTON "OK",         IDOK, 146,   6,  50,  14
  113.   PUSHBUTTON    "Cancel", IDCANCEL, 146,  24,  50,  14
  114. END
  115.